package com.ruoyi.tools.util.param;

import org.apache.commons.codec.binary.Base64;

import java.io.UnsupportedEncodingException;

public class CodeUtil {

    public static String encodeToString(String msg){
        //编码
        String encodeBase64String=null;
        try {
            encodeBase64String = Base64.encodeBase64String(msg.getBytes("UTF-8"));
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
//        System.out.println(encodeBase64String);
        return encodeBase64String;
    }
}
